﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GetCourseForHome.ascx.cs" Inherits="NLLSite.UserControl.GetCourseForHome" %>
<asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1" 
    EnableModelValidation="True">
    
    <EmptyDataTemplate>
        
                    Hiện chưa có khóa học nào
    </EmptyDataTemplate>
    
    <ItemTemplate>
        <tr  style="color:#333333;background-color:#F7F6F3;">
            
            <td>
                <a style="font-weight:bold;" href="/khoa-hoc/<%# Eval("ID") %>/<%#ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Name").ToString())%>"><%# Eval("Name") %> </a>
            </td>
            
            <td>
                <asp:Label ID="QuantitiesLabel" runat="server" 
                    Text='<%# Eval("Quantities") %>' />
            </td>
            <td>
                <asp:Label ID="StartDateLabel" runat="server" Text='<%# Eval("StartDate") %>' />
            </td>
            <td>
                <asp:Label ID="ScheduleLabel" runat="server" Text='<%# Eval("Schedule") %>' />
            </td>
            <td>
                <asp:Label ID="TimeSlotLabel" runat="server" Text='<%# Eval("TimeSlot") %>' />
            </td>
            <td>
                <%#StatusDangKy((bool)DataBinder.Eval(Container.DataItem, "Status"))%>
            </td>
        </tr>
    </ItemTemplate>
    <LayoutTemplate>
        <table id="Table2" runat="server">
            <tr id="Tr1" runat="server">
                <td id="Td1" runat="server">
                    <table ID="itemPlaceholderContainer" runat="server" cellspacing="0" cellpadding="4" border="0" style="color:#333333;width:540px;border-collapse:collapse;">
                        <tr id="Tr2" runat="server" style="color:White;background-color:#5D7B9D;font-weight:bold;">
                           
                            <th id="Th2" runat="server">
                                Tên khóa học</th>
                            
                            <th id="Th3" runat="server">
                                Số lượng</th>
                            <th id="Th4" runat="server">
                                Ngày bắt đầu</th>
                            <th id="Th5" runat="server">
                                Lịch Học</th>
                            <th id="Th6" runat="server">
                                Giờ học</th>
                                <th id="Th7"  runat="server">
                                </th>
                        </tr>
                        <tr ID="itemPlaceholder" runat="server">
                        </tr>
                    </table>
                </td>
            </tr>
            <tr id="Tr3" runat="server">
                <td id="Td2" runat="server" 
                    style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
                </td>
            </tr>
        </table>
    </LayoutTemplate>
   
</asp:ListView>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" 
    ContextTypeName="DAL_Class.NLLDataContext" 
    Select="new (ID, Name, Content, Quantities, StartDate, Schedule, TimeSlot, Status)" 
    TableName="Courses" 
    Where="IsFrontPage == @IsFrontPage">
    <WhereParameters>
        <asp:Parameter DefaultValue="True" Name="IsFrontPage" Type="Boolean" />
    </WhereParameters>
</asp:LinqDataSource>
